import request from '@/utils/request'

// 获取投票列表
export const getTicketListApi = (params) => request({
  url: '/ticket',
  method: 'get',
  params
})

// 新增投票
export const addTicketApi = (data) => request({
  url: '/ticket',
  method: 'post',
  data
})

// 获取投票信息
export const getTicketApi = (id) => request({
  url: '/ticket/' + id,
  method: 'get'
})

// 修改投票
export const editTicketApi = (data) => request({
  url: '/ticket/' + data.id,
  method: 'put',
  data
})

// 删除投票
export const delTicketApi = (id) => request({
  url: '/ticket/' + id,
  method: 'delete'
})